package com.jizhi.onework.dataobj.dto;

import com.jizhi.onework.framework.model.BaseDTO;
import com.jizhi.onework.pojo.User;

import java.util.Date;

/**
 * 用户对象数据传输层
 *
 * @author hzhang7
 */
public class UserDTO extends BaseDTO<User> {

    private Long id;

    private Date createTime;

    private Date lastLoginTime;

    private String password;

    private String phone;

    private Date updateTime;

    private String headImg;

    private String name;

    private String userName;

    private Long roleId;

    private String salt;

    private String email;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return super.toString();
    }

    @Override
    public User toDO() {
        User userDO = new User();
        userDO.setId(id);
        userDO.setCreateTime(createTime);
        userDO.setLastLoginTime(lastLoginTime);
        userDO.setPassword(password);
        userDO.setPhone(phone);
        userDO.setUpdateTime(updateTime);
        userDO.setHeadImg(headImg);
        userDO.setName(name);
        userDO.setUserName(userName);
        userDO.setRoleId(roleId);
        userDO.setSalt(salt);
        userDO.setEmail(email);
        return userDO;
    }
}